@extends('backstage.layout.master')
@section('title', '添加创作区域')
@section('style')
        <!-- page specific plugin styles -->

<link rel="stylesheet" href="assets/css/jquery-ui-1.10.3.custom.min.css"/>
<link rel="stylesheet" href="assets/css/chosen.css"/>
<link rel="stylesheet" href="assets/css/datepicker.css"/>
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.css"/>
<link rel="stylesheet" href="assets/css/daterangepicker.css"/>
<link rel="stylesheet" href="assets/css/colorpicker.css"/>

<!-- fonts -->

@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a target="_blank" href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a target="_blank" href="/backstage/product-temp/product-temp-list">产品模板</a>
            </li>
            <li>
                添加创作区域
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        产品
                        <small>
                            <i class="icon-double-angle-right"></i>
                            添加创作区域
                        </small>
                        <span class="pull-right">
                        <button class="btn btn-primary" onclick="javascript:window.location.href='{{asset('')}}backstage/product-temp/custom-zone-list-page?product_temp_id={{empty($_GET['product_temp_id'])?'':$_GET['product_temp_id']}}&colour_id={{empty($_GET['colour_id'])?'0':$_GET['colour_id']}}';">返回设计区域列表</button>
                     </span>
                    </h1>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <h3 class="header smaller lighter red">产品模板简介：</h3>
                        <div class="well">
                            <h4 class="green smaller lighter">产品模板参数</h4>
                            1、产品模板Id：{{isset($product_temp->product_temp_id)?$product_temp->product_temp_id:""}}</br>
                            2、品牌：{{isset($product_temp->brand_name)?$product_temp->brand_name:""}}</br>
                            3、产品模板名称：{{isset($product_temp->name)?$product_temp->name:""}}</br>
                            4、产品模板简介：{{isset($product_temp->description)?$product_temp->description:""}}</br>
                            5、当前颜色：{{isset($temp_colour->colour_name)?$temp_colour->colour_name:""}}</br>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->

                        <form class="form-horizontal" role="form" action="/backstage/product-temp/add-custom-zone" method="post" enctype="multipart/form-data">
                            <div class="form-group {{$errors->first('product_temp_id')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 产品模板Id </label>

                                <div class="col-sm-4">
                                    <input type="text" name="product_temp_id" readonly value="{{isset($product_temp->product_temp_id)?$product_temp->product_temp_id:''}}"class="width-100">
                                    <input type="hidden" name="colour_id" value="{{isset($temp_colour->colour_id)?$temp_colour->colour_id:0}}">
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('product_temp_id')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('colour_code')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 背景颜色色值 </label>
                                <div class="col-sm-4">
                                    <input type="text" name="colour_code" id="colour_code" value="{{ (old('colour_code')=='')?'#E0E0E6': old('colour_code')}}" placeholder="色值"
                                           class="width-100 colorpicker">
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('colour_code')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group ">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">区域选择</label>
                                <div class="col-sm-4">
                                    <select name="position_type" class="form-control" id="form-field-select-1">
                                        @foreach($custom_zone_positions as $zone_position)
                                        <option value={{isset($zone_position->position_type)?$zone_position->position_type:0}}>{{isset($zone_position->position_name)?$zone_position->position_name:''}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('custom_w_and_screen_w_ratio')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">定制区域宽和屏宽比 </label>
                                <div class="col-sm-4">
                                    <input type="number"  name="custom_w_and_screen_w_ratio" id="custom_w_and_screen_w_ratio" step=0.01 min=0 value=0.7
                                           class="width-100">
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('custom_w_and_screen_w_ratio')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('custom_aspect_ratio')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 定制区域宽高比 </label>
                                <div class="col-sm-4">
                                    <input type="number" name="custom_aspect_ratio" id="custom_aspect_ratio" step=0.01 min=0 value=0.7 placeholder="宽高比"
                                           class="width-100">
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('colour_code')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('image')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
                                    创作区域图片 </label>

                                <div class="col-sm-4">
                                    <input type="file"  name="image" placeholder="图片">
                                </div>
                                <div class="col-sm-5">
                                    <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('image')}}</div>
                                </div>
                            </div>
                            <div class="clearfix form-actions">
                                <div class="col-md-offset-3 col-md-9">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        保存
                                    </button>
                                </div>
                            </div>
                        </form>


                    </div><!-- /.col -->
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script src="assets/js/bootstrap-colorpicker.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#image').ace_file_input({
                no_file: '还未选择图片',
                btn_choose: '选择',
                btn_change: '重新选择',
                droppable: false,
                onchange: null,
                thumbnail: true //| true | large
            });
            $('.colorpicker').colorpicker();
          });
    </script>
@stop
